//
//  PILine.m
//  iPaint
//
//  Created by Jedd Haberstro on 2/12/07.
//  Copyright 2007 __MyCompanyName__. All rights reserved.
//

#import "PILine.h"


@implementation PILine

- (id)init {
    self = [super init];
    if (self) {
		[self setStrokeColor:[NSColor blackColor]];
	}
	return self;
}

-(void)dealloc
{	[_fillColor release];
   	[_strokeColor release];
	[_path release];
   	[super dealloc];
}

/////////////////////
// Get _firstPoint //
/////////////////////
-(NSPoint)firstPoint
{
	return _firstPoint;
}

////////////////////
// Get _nextPoint //
//////////////////// 
-(NSPoint)nextPoint
{
	return _nextPoint;
}

/////////////////////////////////
// Set location of _firstPoint //
/////////////////////////////////
-(void)setFirstPoint:(NSPoint)point
{
	_firstPoint = point;
}

////////////////////////////////
// Set Location of _nextPoint //
////////////////////////////////
-(void)setNextPoint:(NSPoint)point
{
	_nextPoint = point;
}

//////////////////////////////////////////////////////////////
// Sets the first point of the _path intance to _firstPoint //
//////////////////////////////////////////////////////////////
-(void)setStartPointOfPath
{
	[_path moveToPoint:_firstPoint];
}

////////////////////////////////////////////////////////
// Adds the _nextPoint point to the _path intance var //
////////////////////////////////////////////////////////
-(void)addPointToPath
{
	[_path lineToPoint:_nextPoint];
}

////////////////////////////////////////
// Draw the path (_path instance var) //
////////////////////////////////////////
-(void)draw
{
	[[self strokeColor] set];
	[_path stroke];
}

@end
